package com.hsj.goldstore.mvpDemo.present;

import android.util.Log;

import com.hsj.goldstore.mvpDemo.model.CallBack;
import com.hsj.goldstore.mvpDemo.model.UserModel;
import com.hsj.goldstore.mvpDemo.view.IUserView;

/**
 * Created by Administrator on 2018/3/27.
 */

public class UserPresenter implements IUserPresenter {
    private static final String TAG = "UserPresenter";
    private UserModel userModel = new UserModel();
    private IUserView userView;

    public UserPresenter(IUserView userView) {
        this.userView = userView;
    }

    @Override
    public void login() {
        userModel.login("1333", "1111", new CallBack() {
            @Override
            public void onSuccess(String msg) {
                userView.showSuccess(msg);
            }

            @Override
            public void onError(String err) {
                userView.showErr(err);
            }
        });
    }
}
